package com.sz.biz.app.web.config;

import org.springframework.boot.web.servlet.MultipartConfigFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.servlet.MultipartConfigElement;

/**
 * Function: SystemConfig <br>
 * Author: wentao.chang <br>
 * Date: 2016-12-14 16:06:00
 */
@Configuration
public class SystemConfig {
    //最大10MB
    private static long MAX_FILE_SIZE = 10 * 1024 * 1024;

    @Bean
    public MultipartConfigElement multipartConfigElement() {
        MultipartConfigFactory factory = new MultipartConfigFactory();
        factory.setMaxFileSize(MAX_FILE_SIZE);
        return factory.createMultipartConfig();
    }
}
